// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "Common",
    platforms: [
        .iOS(.v14), // 这里设置最低支持iOS14
    ],
    products: [
        // Products define the executables and libraries a package produces, making them visible to other packages.
        .library(
            name: "Common",
            targets: ["Common"]),
    ],
    dependencies: [
        .package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.0.0")),
        .package(url: "https://github.com/RxSwiftCommunity/RxDataSources.git", .upToNextMajor(from: "5.0.0")),
        .package(url: "https://github.com/CoderMJLee/MJRefresh", .upToNextMajor(from: "3.7.0")),
        .package(url: "https://github.com/jdg/MBProgressHUD.git", .upToNextMajor(from: "1.2.0")),
        .package(url: "https://github.com/intsig171/SmartCodable.git", from: "4.3.0"),
        .package(url: "https://github.com/RxSwiftCommunity/RxAlamofire.git", from: "6.1.0"),
        .package(url: "https://github.com/Moya/Moya.git", .upToNextMajor(from: "15.0.0")),
        .package(url: "https://github.com/aheze/SwipeActions", .upToNextMajor(from: "1.1.0")),
//        .package(url: "https://github.com/SDWebImage/SDWebImage.git", from: "5.1.0"),
//        .package(url: "https://github.com/onevcat/Kingfisher.git", from: "8.0.0"),
//        .package(url: "https://github.com/SnapKit/SnapKit.git", .upToNextMajor(from: "5.7.0")),
//        .package(url: "https://github.com/alibaba/HandyJSON", from: "4.1.0"),
    ],
    targets: [
        .target(
            name: "Common",
            dependencies: [
                "RxSwift",
                "RxDataSources",
                .product(name: "RxCocoa", package: "RxSwift"),
                "MJRefresh",
                "MBProgressHUD",
                "SmartCodable",
                "RxAlamofire",
                "Moya",
                .product(name: "RxMoya", package: "Moya"),
                "SwipeActions"
            ],
//            path: "Sources/Common",
            resources: [
                .process("Resources")
            ]
        )
    ]
)
